package api;

import java.math.BigInteger;

public class Biginteger {
    public static void main(String[] args) {
        //创建两个BigInteger对象
        BigInteger bd1 = BigInteger.valueOf(11);
        BigInteger bd2 = BigInteger.valueOf(2);

        //加法
        BigInteger bd3 = bd1.add(bd2);
        System.out.println(bd3);

        //除法

        BigInteger []arr = bd1.divideAndRemainder(bd2);
        System.out.println(arr[0]);
        System.out.println(arr[1]);

        //比较是否相同
        boolean flag = bd1.equals(bd2);
        System.out.println(flag);

        //次幂
        BigInteger bd5 = bd1.pow(2);
        System.out.println(bd5);

        //max
        BigInteger bd6 = bd1.max(bd2);
        System.out.println(bd6);

        //转为int类整数
        int i = bd6.intValue();
        BigInteger bd7 = BigInteger.valueOf(200);
        double d = bd7.doubleValue();
        System.out.println(d);
    }
}
